using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using SmartBoard.Core.Serialization;

namespace SmartBoard.Background.Serialization
{
    internal class V10SerializationStrategy:ISerializationStrategy
    {
        private readonly BinaryFormatter _binaryFormatter;

        public V10SerializationStrategy()
        {
            this._binaryFormatter = new BinaryFormatter();
        }

        public void Serialize(Stream stream, object obj)
        {
            _binaryFormatter.Serialize(stream, obj);
        }

        public object Deserialize(Stream stream)
        {
            return _binaryFormatter.Deserialize(stream);
        }
    }
}